import{d as B,k as D,B as L,a as m,o as i,b as c,w as s,q as p,e as t,m as N,f as n,E as $,W as h,t as o,F as _,c as f,U as A,K as P,D as E,p as C,n as x,a3 as I,_ as K}from"./index-c80Lh_is.js";import{A as T}from"./AppCollection-jlsv_00S.js";import{L as q}from"./LinkBox-dXHA5onU.js";import{S as F}from"./StatusBadge-UNqSn95Q.js";import{S as U}from"./SummaryView-SP5kl4lM.js";const W=B({__name:"ServiceListView",setup(O){const y=D(),d=L();return(Z,j)=>{const S=m("RouteTitle"),u=m("RouterLink"),z=m("KCard"),V=m("RouterView"),b=m("AppView"),g=m("DataSource"),R=m("RouteView");return i(),c(g,{src:"/me"},{default:s(({data:k})=>[k?(i(),c(R,{key:0,name:"service-list-view",params:{page:1,size:k.pageSize,mesh:"",service:""}},{default:s(({route:a,t:r})=>[t(g,{src:`/meshes/${a.params.mesh}/service-insights/of/${p(y)("use gateways ui")?"internal":"all"}?page=${a.params.page}&size=${a.params.size}`},{default:s(({data:l,error:v})=>[t(b,null,I({title:s(()=>[N("h2",null,[t(S,{title:r(`${p(d).name==="service-list-view"?"":"external-"}services.routes.items.title`)},null,8,["title"])])]),default:s(()=>[n(),n(),t(z,null,{default:s(()=>[v!==void 0?(i(),c($,{key:0,error:v},null,8,["error"])):(i(),c(T,{key:1,class:"service-collection","data-testid":"service-collection","empty-state-message":r("common.emptyState.message",{type:"Services"}),headers:[{label:"Name",key:"name"},{label:"Address",key:"addressPort"},{label:"DP proxies (online / total)",key:"online"},{label:"Status",key:"status"},{label:"Details",key:"details",hideLabel:!0}],"page-number":a.params.page,"page-size":a.params.size,total:l==null?void 0:l.total,items:l==null?void 0:l.items,error:v,"is-selected-row":e=>e.name===a.params.service,onChange:a.update},{name:s(({row:e})=>[t(h,{text:e.name},{default:s(()=>[t(u,{to:{name:"service-detail-view",params:{mesh:e.mesh,service:e.name},query:{page:a.params.page,size:a.params.size}}},{default:s(()=>[n(o(e.name),1)]),_:2},1032,["to"])]),_:2},1032,["text"])]),addressPort:s(({row:e})=>[e.addressPort?(i(),c(h,{key:0,text:e.addressPort},null,8,["text"])):(i(),f(_,{key:1},[n(o(r("common.collection.none")),1)],64))]),online:s(({row:e})=>[e.dataplanes?(i(),f(_,{key:0},[n(o(e.dataplanes.online||0)+" / "+o(e.dataplanes.total||0),1)],64)):(i(),f(_,{key:1},[n(o(r("common.collection.none")),1)],64))]),status:s(({row:e})=>[t(F,{status:e.status},null,8,["status"])]),details:s(({row:e})=>[t(u,{class:"details-link","data-testid":"details-link",to:{name:"service-detail-view",params:{mesh:e.mesh,service:e.name}}},{default:s(()=>[n(o(r("common.collection.details_link"))+" ",1),t(p(A),{display:"inline-block",decorative:"",size:p(P)},null,8,["size"])]),_:2},1032,["to"])]),_:2},1032,["empty-state-message","headers","page-number","page-size","total","items","error","is-selected-row","onChange"]))]),_:2},1024),n(),a.params.service?(i(),c(V,{key:0},{default:s(e=>[t(U,{onClose:w=>a.replace({name:"service-list-view",params:{mesh:a.params.mesh},query:{page:a.params.page,size:a.params.size}})},{default:s(()=>[(i(),c(E(e.Component),{name:a.params.service,service:l==null?void 0:l.items.find(w=>w.name===a.params.service)},null,8,["name","service"]))]),_:2},1032,["onClose"])]),_:2},1024)):C("",!0)]),_:2},[p(y)("use gateways ui")?{name:"actions",fn:s(()=>[t(q,null,{default:s(()=>[t(u,{class:x({active:p(d).name==="service-list-view"}),to:{name:"service-list-view",params:{mesh:a.params.mesh}}},{default:s(()=>[n(o(r("services.routes.items.navigation.internal")),1)]),_:2},1032,["class","to"]),n(),t(u,{class:x({active:p(d).name==="external-service-list-view"}),to:{name:"external-service-list-view",params:{mesh:a.params.mesh}}},{default:s(()=>[n(o(r("services.routes.items.navigation.external")),1)]),_:2},1032,["class","to"])]),_:2},1024)]),key:"0"}:void 0]),1024)]),_:2},1032,["src"])]),_:2},1032,["params"])):C("",!0)]),_:1})}}}),X=K(W,[["__scopeId","data-v-8187fa37"]]);export{X as default};
